import re_generator,re

f1=open('re_testfile.txt','r')
pattern=re.compile("(\S+)\s+(\S+)")
for line in f1:
    match=re.search(pattern,line)
    if match :
        url=match.group(1)
        if url[0]!="#" :
            match_num=match.group(2)
            print "from testfile, url is "+url+",match_num is "+match_num
            ret_url=re_generator.re_generator_by_url(url,match_num)
            if ret_url != [] :
                print "good, found matching"
            else :
                print "bad, fail to match!"
                exit()
        else :
            print("ignore comment line")
    else : 
        print "cannot parse line:"+line

